:root {
  color-scheme: dark;
}

* {
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 15% 10%, rgba(217, 93, 69, 0.2), transparent 24rem),
    linear-gradient(145deg, #101318, #171c24 54%, #111418);
  touch-action: manipulation;
}

.app-nav {
  min-height: 4.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(16, 19, 24, 0.76);
  backdrop-filter: blur(0.75rem);
}

.brand-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 0.4rem;
}

.navbar-brand {
  font-size: 1rem;
  font-weight: 800;
}

.pads-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: calc(100vh - 4.25rem);
}

.transport-band,
.bindings-band {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(18, 22, 29, 0.72);
}

.bindings-band {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 0;
}

.transport-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 3.5rem;
  padding: 0.55rem 0.75rem;
}

.transport-soundbank {
  flex: 1 1 12rem;
  max-width: 22rem;
}

.status-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--bs-secondary-color);
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pads-workspace {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 0.9rem;
}

.pad-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: clamp(0.45rem, 2vw, 0.8rem);
  width: min(100%, 38rem);
  height: min(calc(100vh - 13.5rem), 38rem);
  min-height: min(100vw - 1.8rem, 20rem);
  aspect-ratio: 1;
}

.drum-pad {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  min-height: 0;
  padding: clamp(0.55rem, 2.4vw, 0.9rem);
  border: 1px solid color-mix(in srgb, var(--pad-color), white 22%);
  border-radius: 0.5rem;
  color: #fff;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--pad-color), #121720 72%), rgba(20, 25, 35, 0.96)),
    radial-gradient(circle at 80% 15%, color-mix(in srgb, var(--pad-color), transparent 44%), transparent 52%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 0.7rem 1.4rem rgba(0, 0, 0, 0.28);
  touch-action: none;
  user-select: none;
}

.drum-pad:focus-visible,
.drum-pad:hover {
  border-color: color-mix(in srgb, var(--pad-color), white 54%);
}

.drum-pad.is-playing {
  transform: translateY(0.08rem) scale(0.985);
  filter: brightness(1.28);
}

.pad-key {
  align-self: start;
  min-width: 1.45rem;
  padding: 0.12rem 0.32rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0.3rem;
  background: rgba(0, 0, 0, 0.28);
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(0.68rem, 2.5vw, 0.82rem);
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
}

.pad-note {
  font-size: clamp(1.08rem, 6vw, 1.75rem);
  font-weight: 900;
  line-height: 1;
}

.pad-name {
  min-height: 2.15em;
  overflow-wrap: anywhere;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(0.68rem, 2.6vw, 0.84rem);
  font-weight: 700;
  line-height: 1.08;
}

.keyboard-bindings {
  display: grid;
  gap: 0.35rem;
  padding: 0.6rem 0.75rem 0.75rem;
}

.keyboard-bindings-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 4.5rem));
  justify-content: center;
  gap: 0.35rem;
}

.binding-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-width: 0;
  padding: 0.28rem 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.35rem;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.75rem;
}

.binding-chip kbd {
  min-width: 1.35rem;
  padding: 0.08rem 0.25rem;
  border-radius: 0.22rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
}

@media (max-width: 430px) {
  .navbar-brand span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .transport-controls {
    flex-wrap: wrap;
  }

  .transport-soundbank {
    max-width: none;
  }

  .status-text {
    flex-basis: 100%;
  }
}
