/* Shared by the three sequencing sketches. Tokens, the top bar, panels, lanes. */
@import url('https://fonts.googleapis.com/css2?family=MuseoModerno:wght@500;700&family=Instrument+Sans:wght@400;500;600&family=Caveat:wght@500;600&display=swap');

:root {
  --ground: #16171a;
  --surface: #1f2125;
  --raised: #282b31;
  --line: #33363d;
  --text: #ece9e2;
  --muted: #9a9ea8;
  --faint: #6f737d;
  --green: #1db954;
  --cyan: #00d4ff;
  --pencil: #e9c96b;
  --journey: linear-gradient(90deg, var(--green), var(--cyan));
  --ui: 'Instrument Sans', system-ui, sans-serif;
  --brand: 'MuseoModerno', sans-serif;
  --hand: 'Caveat', cursive;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 400 15px/1.45 var(--ui);
  -webkit-font-smoothing: antialiased;
}
button, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
h1 { font: 700 30px/1.1 var(--brand); margin: 0; }
.sub { color: var(--muted); margin: 6px 0 0; }

/* top bar */
#bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center;
  padding: 10px 20px;
  background: color-mix(in srgb, var(--ground) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.mark {
  font: 700 17px var(--brand); text-decoration: none;
  background: var(--journey); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.dirs { display: flex; gap: 2px; background: var(--surface); border-radius: 999px; padding: 3px; }
.dirs a { padding: 5px 12px; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 13.5px; }
.dirs a[aria-current] { background: var(--raised); color: var(--text); }
.pick select { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; max-width: 46vw; }
.tools { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.btn {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 12px; cursor: pointer; white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: #4d515b; }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn[aria-pressed='true'] { border-color: var(--cyan); color: var(--cyan); }
.btn.go { background: var(--text); color: var(--ground); border-color: var(--text); font-weight: 600; }
.btn.quiet { background: none; border-color: transparent; color: var(--muted); }
.btn.lock { background: var(--journey); color: #06120c; border: 0; font-weight: 600; padding: 7px 14px; }

/* panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; min-width: 0; }
.panel h2 { font: 600 14px var(--ui); margin: 0 0 10px; color: var(--muted); }
.hint { color: var(--faint); font-size: 13.5px; margin: 10px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; cursor: pointer; font-size: 14px;
}
.chip:hover:not(:disabled) { border-color: #4d515b; }
.chip:disabled { opacity: 0.4; cursor: default; }
.chip[aria-pressed='true'] { background: var(--text); color: var(--ground); border-color: var(--text); }

.lines { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.lines label { color: var(--muted); font-size: 14px; }
.lines select { background: var(--ground); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; margin-left: 4px; }
.lines .lbl { color: var(--faint); font-size: 13.5px; margin: 12px 0 6px; }

.cv { display: block; background: var(--raised); object-fit: cover; border-radius: 4px; }
.cv.blank { background: repeating-linear-gradient(45deg, #2c2f36 0 5px, #23262c 5px 10px); }

.hold { display: grid; grid-template-columns: 64px 1fr; gap: 4px 12px; align-items: start; }
.hold .cv { width: 64px; height: 64px; grid-row: span 3; }
.hold p { margin: 0; overflow-wrap: anywhere; }
.hold .t { font-weight: 600; }
.hold .a { color: var(--muted); }
.hold .f { color: var(--faint); font-size: 13.5px; }
.hold textarea {
  grid-column: 1 / -1; margin-top: 8px; width: 100%; min-height: 62px; resize: none;
  font: 500 22px/1.2 var(--hand); color: var(--pencil);
  background: none; border: 0; border-bottom: 1px dashed var(--line); padding: 2px 0 6px;
}
.hold textarea::placeholder { color: #6d6548; }
.hold .moves { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.cutlist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 18px; }
.cutlist li { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.cutlist .cv { width: 36px; height: 36px; opacity: 0.7; }
.cutlist p { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cutlist .a { color: var(--muted); font-size: 13.5px; }
[hidden] { display: none !important; }

.idea p { margin: 0 0 12px; }
.idea b { font-weight: 600; }
.idea .acts { display: flex; gap: 6px; }

/* the moment it is done */
.locked { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); margin: 16px 0 0; }
.locked p { margin: 0; }
.locked b { font-weight: 600; }
.eq { display: inline-flex; gap: 3px; align-items: flex-end; height: 22px; flex: none; }
.eq span { width: 4px; height: 100%; border-radius: 2px; background: linear-gradient(var(--cyan), var(--green)); transform-origin: bottom; animation: eq 0.9s ease-in-out 2 both; }
.eq span:nth-child(2) { animation-delay: 0.12s; }
.eq span:nth-child(3) { animation-delay: 0.24s; }
.eq span:nth-child(4) { animation-delay: 0.08s; }
.eq span:nth-child(5) { animation-delay: 0.2s; }
@keyframes eq { 0%, 100% { transform: scaleY(0.35); } 50% { transform: scaleY(1); } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
body.just-done .line.lead { stroke-dasharray: 1; animation: draw 1.4s ease-out both; }

/* lanes (svg) */
svg.lanes { display: block; overflow: visible; }
.line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: d 0.22s ease; }
.line.lead { stroke-width: 3; }
.area { stroke: none; fill-opacity: 0.2; transition: d 0.22s ease; }
.line.other { stroke: #b4b7c0; }
/* the handles that bend the shape */
.handle { fill: var(--pencil); stroke: var(--ground); stroke-width: 2; pointer-events: none; }
.handle-hit { fill: transparent; cursor: grab; touch-action: none; }
.handle-hit:hover { fill: rgba(233, 201, 107, 0.16); }
.line.ghost { stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 3 5; opacity: 0.85; transition: none; }
.target { fill: none; stroke: var(--pencil); stroke-width: 1.5; stroke-dasharray: 1 6; stroke-linecap: round; opacity: 0.9; }
.gap.stub { opacity: 0.55; }
.gap.none { fill: none; stroke: #4a4e57; stroke-dasharray: 2 4; }
.hit { fill: transparent; cursor: pointer; }
.selband { fill: #fff; opacity: 0.05; pointer-events: none; }
.doubt { fill: var(--ground); stroke: #c9cbd3; stroke-width: 1.5; cursor: pointer; }
.doubt.halved { fill: #c9cbd3; }
.lname { font: 500 12px var(--ui); fill: var(--muted); paint-order: stroke; stroke: var(--ground); stroke-width: 4px; pointer-events: none; }
.seam { stroke: var(--cyan); stroke-width: 2; stroke-linecap: round; opacity: 0.75; fill: none; }
.seam.same { stroke-width: 4; opacity: 1; }

/* dragging */
.lifted { position: fixed; z-index: 60; pointer-events: none; margin: 0; rotate: -2deg; opacity: 0.97; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6); }
.lifting { opacity: 0.22; }
body.dragging, body.dragging * { cursor: grabbing !important; user-select: none; }
.grip { touch-action: none; cursor: grab; color: var(--faint); }

.keys-help { color: var(--faint); font-size: 13px; margin: 18px 0 0; }
.was { font-size: 12px; color: var(--pencil); border: 1px solid #5c5333; border-radius: 999px; padding: 0 7px; white-space: nowrap; }
.cam { font-size: 11.5px; color: var(--cyan); }

/* phone: a bar to move the chosen track without dragging */
#mover { display: none; }
@media (max-width: 760px) {
  #bar { position: static; padding: 8px 12px; gap: 8px; }
  .tools { margin-left: 0; }
  .hold .moves [data-act='earlier'], .hold .moves [data-act='later'] { display: none; } /* the bar at the bottom does these on a phone */
  h1 { font-size: 24px; }
  .keys-help { display: none; }
  #mover.on {
    display: flex; gap: 8px; align-items: center;
    position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 30;
    padding: 8px 10px; border-radius: 14px; background: var(--raised); border: 1px solid var(--line);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  }
  #mover .mt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
  body { padding-bottom: 76px; }
}
@media (prefers-reduced-motion: reduce) {
  .eq span, body.just-done .line.lead { animation: none; }
  .line, .area { transition: none; }
}
