@import '../machine/base.css';
@import '../machine/controls.css';
@import '../machine/file-button.css';
@import '../machine/rig.css';
@import '../machine/drop.css';
@import '../machine/matzkaim.css';
@import '../machine/thumb-deck.css';

/* one slab: the map of the groove, the few choices beside it, the deck under the thumb */
.page:has(.p2-machine) {
  max-width: min(1500px, 96vw);
  padding-block-end: 96px;
}

.p2-machine {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 12px;
}

.p2-top,
.p2-stage,
.p2-bench {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
}

.p2-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.p2-row .btn,
.p2-row .chip {
  min-block-size: 44px;
  white-space: nowrap;
}

.p2-row .grid-label {
  min-inline-size: 72px;
}

.p2-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.p2-bpm {
  inline-size: 92px;
  min-block-size: 44px;
  text-align: center;
}

.p2-map {
  display: block;
  inline-size: 100%;
  min-block-size: 120px;
  border: 1px solid var(--depth, #333);
  cursor: pointer;
  touch-action: manipulation;
}

.p2-recipe {
  overflow-wrap: anywhere;
  user-select: all;
}

.p2-deck {
  grid-template-columns: 1fr 1.3fr 1fr 1.2fr 0.9fr;
}

.p2-deck .deck-key:disabled {
  color: var(--muted);
  border-color: var(--depth);
  cursor: default;
}

@media (min-width: 1000px) {
  .p2-machine {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    align-items: start;
    gap: 16px;
  }

  .p2-top {
    grid-column: 1 / -1;
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .p2-stage {
    position: sticky;
    top: 8px;
  }
}
