/* Move It, MJ! - builds on ../style.css */

.g-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 24px 24px;
  display: grid;
  gap: 24px;
}

.g-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 22px;
  overflow: hidden;
  background: #07060a;
  box-shadow: 0 0 0 1px var(--line), 0 30px 80px -30px #000;
}
.g-stage canvas { display: block; width: 100%; height: 100%; }

.g-progress {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 14px;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .14);
  overflow: hidden;
  opacity: 0;
  transition: opacity 200ms;
}
.g-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--move);
  border-radius: inherit;
}
.performing .g-progress { opacity: 1; }

.g-end {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 4px;
  text-align: center;
  background: radial-gradient(closest-side, rgba(12, 10, 16, .78), rgba(12, 10, 16, .35));
  animation: fadeIn 300ms ease-out;
}
.g-end[hidden] { display: none; }
.g-end-title {
  margin: 0;
  font-family: var(--brush);
  font-size: clamp(56px, 9vw, 120px);
  line-height: .9;
  color: var(--gold);
  transform: rotate(-4deg);
}
.g-end-sub { margin: 0 0 14px; color: var(--text); font-size: 17px; }
.g-end-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
@keyframes fadeIn { from { opacity: 0; } }

.g-controls { justify-content: flex-start; }

/* Music / Beat / Off */
.seg {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
}
.seg button {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--brush);
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
  transition: background 120ms, color 120ms;
}
.seg button:hover { color: var(--text); }
.seg button[aria-checked="true"] { background: var(--gold); color: #1a1206; }
.seg button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.tempo.locked { opacity: .55; }

/* ---------- editor ---------- */
.g-editor { display: grid; gap: 22px; transition: opacity 250ms; }
.performing .g-editor { opacity: .45; pointer-events: none; }

.g-block {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(28, 23, 36, .6);
}
.g-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
  margin-bottom: 14px;
}
.g-head h2 {
  margin: 0;
  font-family: var(--brush);
  font-weight: 400;
  font-size: 32px;
  line-height: 1;
}
.hint { margin: 0; color: var(--muted); font-size: 14px; }
.g-tools { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 19px; }

/* venues */
.venues {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.venue {
  position: relative;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  cursor: pointer;
  aspect-ratio: 16 / 7;
  transition: transform 140ms, border-color 140ms;
}
.venue img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .7; transition: opacity 140ms; }
.venue span {
  position: absolute;
  left: 12px;
  right: 8px;
  bottom: 8px;
  font-family: var(--brush);
  font-size: 23px;
  line-height: 1;
  color: #fff;
  text-shadow: 0 2px 10px #000;
}
.venue:hover img { opacity: .95; }
.venue:hover { transform: rotate(-.6deg); }
.venue[aria-checked="true"] { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.venue[aria-checked="true"] img { opacity: 1; }
.venue[aria-checked="true"]::after {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--gold);
  color: #1a1206;
  font-weight: 800;
  font-size: 14px;
}
.venue:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* move library */
.library {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.card {
  width: 100%;
  display: grid;
  grid-template-columns: 50px 1fr;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  text-align: left;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 140ms, background 140ms, border-color 140ms;
}
.card:hover { background: #241c2e; border-color: var(--c); transform: rotate(-1deg); }
.card:active { cursor: grabbing; }
.card:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.card .thumb {
  height: 58px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--c) 30%, #0e0b12);
  display: grid;
  place-items: end center;
  overflow: hidden;
}
.card .thumb img { height: 54px; width: auto; pointer-events: none; }
.card .name { font-family: var(--brush); font-size: 23px; line-height: 1.05; }
.card .len { display: block; font-family: var(--ui); font-size: 12px; color: var(--muted); }

/* timeline */
.timeline {
  list-style: none;
  margin: 0;
  padding: 14px;
  min-height: 132px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  border: 2px dashed #3a3046;
  border-radius: 18px;
  background:
    repeating-linear-gradient(90deg, transparent 0 59px, rgba(255, 255, 255, .03) 59px 60px),
    var(--night-2);
  transition: border-color 140ms, background-color 140ms;
}
.timeline.hot { border-color: var(--gold); }
.timeline .empty {
  width: 100%;
  text-align: center;
  color: var(--muted);
  font-family: var(--brush);
  font-size: 26px;
  pointer-events: none;
}
.chip {
  position: relative;
  width: 104px;
  height: 104px;
  padding: 6px 6px 8px;
  border: 2px solid var(--c);
  border-radius: 16px;
  background: color-mix(in srgb, var(--c) 18%, var(--panel));
  display: grid;
  grid-template-rows: 1fr auto;
  justify-items: center;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 140ms, opacity 140ms, box-shadow 140ms;
}
.chip img { height: 58px; width: auto; align-self: end; pointer-events: none; }
.chip .name {
  font-family: var(--brush);
  font-size: 16px;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 92px;
}
.chip .num {
  position: absolute;
  left: -8px;
  top: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--c);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 0 0 2px #fff;
}
.chip .x {
  position: absolute;
  right: -9px;
  top: -9px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #111;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  opacity: .0;
  transition: opacity 120ms;
}
.chip:hover .x, .chip:focus-within .x, .chip .x:focus-visible { opacity: 1; }
@media (hover: none) { .chip .x { opacity: 1; } }
.chip:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.chip.ghosted { opacity: .25; }
.chip.now { box-shadow: 0 0 0 3px #fff, 0 0 26px var(--c); transform: translateY(-4px) scale(1.04); }
.chip.done { opacity: .55; }
.chip.added { animation: chipIn 380ms cubic-bezier(.2, 1.7, .4, 1); }
@keyframes chipIn { from { transform: scale(.4) rotate(-10deg); opacity: 0; } }

.caret {
  width: 6px;
  height: 96px;
  border-radius: 6px;
  background: var(--gold);
  box-shadow: 0 0 14px var(--gold);
}

/* the thing that follows your finger while dragging */
.drag-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 50;
  pointer-events: none;
  padding: 6px 14px 8px 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--c);
  border-radius: 16px;
  background: color-mix(in srgb, var(--c) 30%, var(--panel));
  box-shadow: 0 18px 40px -10px #000;
  font-family: var(--brush);
  font-size: 22px;
  transform-origin: 20% 50%;
}
.drag-ghost img { height: 54px; }
.drag-ghost.trash { border-color: #fff; background: #4a1418; }
.drag-ghost.trash::after { content: " 🗑"; font-family: var(--ui); font-size: 18px; }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 900px) {
  .library { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .venues { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .venue span { font-size: 21px; }
}
@media (max-width: 600px) {
  .g-layout { padding-left: 16px; padding-right: 16px; }
  .g-stage { aspect-ratio: 4 / 3; border-radius: 18px; }
  .venues { grid-template-columns: minmax(0, 1fr); }
  .venue { aspect-ratio: 16 / 5; }
  .g-block { padding: 14px; }
  .g-tools { margin-left: 0; }
  .timeline { padding: 12px 10px; gap: 12px 10px; }
  .chip { width: 82px; height: 96px; }
  .chip img { height: 52px; }
  .chip .name { font-size: 14px; max-width: 72px; }
  .card .name { font-size: 20px; }
}
