.drum-machine {
  --pad-ink: #f4ebd9;
  --pad-red: #fa3c29;
  color: var(--pad-ink);
  inline-size: 100%;
  min-inline-size: 0;
}
.drum-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(.34rem, 1.1vw, .8rem);
  padding: clamp(.55rem, 1.6vw, 1.1rem);
  border: 1px solid #38332f;
  border-radius: .65rem;
  background:
    radial-gradient(ellipse at 15% 0%, #302b26 0%, transparent 54%),
    linear-gradient(145deg, #1b1918, #090908 76%);
  box-shadow: inset 0 1px 0 #645a4e, inset 0 -2px 3px #000, 0 .4rem 1rem #0007;
}
.drum-machine .drum-pad {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  inline-size: 100%;
  min-inline-size: 0;
  min-block-size: 3.5rem;
  aspect-ratio: 1.25;
  padding: clamp(.35rem, 1.15vw, .74rem);
  border: 1px solid #4c4540;
  border-bottom: .22rem solid #141311;
  border-radius: clamp(.3rem, .6vw, .55rem);
  background:
    repeating-linear-gradient(158deg, #ffffff03 0 1px, transparent 1px 3px),
    linear-gradient(145deg, #35312e, #24221f 74%);
  color: #f4eddd;
  box-shadow: 0 .14rem 0 #000, inset 0 1px 1px #ffffff20;
  font: inherit;
  letter-spacing: normal;
  text-align: left;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: none;
  cursor: pointer;
  transition: transform 85ms ease-out, filter 100ms ease-out;
}
.drum-machine .drum-pad.drum-accent {
  border-color: #a04230;
  border-bottom-color: #471811;
  background:
    repeating-linear-gradient(158deg, #ffffff05 0 1px, transparent 1px 3px),
    linear-gradient(145deg, #a72e1c, #762317);
}
.drum-pad kbd {
  align-self: flex-end;
  color: #eddcc3;
  font: 500 .69rem/1 ui-monospace, monospace;
}
.drum-label {
  font-family: inherit;
  font-size: clamp(.67rem, 1.35vw, .93rem);
  font-weight: 650;
  line-height: 1.05;
  text-transform: none;
  white-space: normal;
}
.drum-machine .drum-pad.is-hit, .drum-machine .drum-pad:active {
  transform: translateY(2px) scale(.985);
  border-color: #ff8d68;
  background: linear-gradient(150deg, #ff8c5c, #ff5135 65%, #ee3929);
  color: #170a05;
  box-shadow: inset 0 1px 2px #ffe2ad85, 0 0 .85rem #ff4a2860;
}
.drum-pad.is-hit kbd, .drum-pad:active kbd { color: #2c1008; }
.drum-machine :focus-visible { outline: 2px solid var(--pad-ink); outline-offset: 3px; }
.drum-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .15rem .8rem;
  padding-block: .65rem .25rem;
}
.drum-level {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 500;
  line-height: 1.3;
}
.drum-level input { width: clamp(5rem, 15vw, 8rem); min-height: 2.5rem; accent-color: var(--pad-red); }
.drum-controls [data-machine-mute] {
  min-height: 2.5rem;
  padding: .28rem .7rem;
  border: 1px solid #655e52;
  border-radius: .2rem;
  background: #161513;
  color: var(--pad-ink);
  font: inherit;
  font-size: .85rem;
  cursor: pointer;
}
.drum-controls [data-machine-mute][aria-pressed=true] { color: #fc7966; }
.drum-machine .drum-hint { margin: .35rem 0 0; color: #c8beb0; font-size: .875rem; line-height: 1.4; }
@media (hover:hover) {
  .drum-machine .drum-pad:hover { filter: brightness(1.15); }
}
@media (prefers-reduced-motion: reduce) {
  .drum-machine .drum-pad { transition: none; }
  .drum-machine .drum-pad.is-hit, .drum-machine .drum-pad:active { transform: none; }
}
