body {
  font-family: Inter, sans-serif;
}

.tool-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .04);
}

/* ── Mode buttons ── */
.mode-btn {
  padding: 5px 12px;
  border-radius: 7px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #6b7280;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.mode-btn.active {
  background: #fff;
  color: #065f46;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.10);
}

/* ── Reverb toggle ── */
.reverb-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 1px;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 3px;
}

.reverb-btn {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #6b7280;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.reverb-btn.active {
  background: #fff;
  color: #065f46;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.10);
}

/* ── Color toggle ── */
.color-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 1px;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 3px;
}

.color-btn {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #6b7280;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.color-btn.active {
  background: #fff;
  color: #065f46;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.10);
}

/* ── Instrument body ── */
.xyl-body {
  position: relative;
  background: linear-gradient(170deg, #3b2008 0%, #1e0f02 100%);
  border-radius: 1rem;
  padding: 48px 20px 24px;
  box-shadow:
    inset 0 2px 8px rgba(255, 180, 80, 0.07),
    inset 0 -4px 20px rgba(0, 0, 0, 0.4),
    0 8px 32px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  min-height: 260px;
}

.xyl-body.color-mode {
  background: linear-gradient(170deg, #1e2a3a 0%, #111d2b 100%);
  box-shadow:
    inset 0 2px 8px rgba(255, 255, 255, 0.05),
    inset 0 -4px 20px rgba(0, 0, 0, 0.4),
    0 8px 32px rgba(0, 0, 0, 0.2);
}

.xyl-body::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 160, 50, 0.07) 0%, transparent 60%);
  pointer-events: none;
}

/* ── Bars container ── */
.xyl-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  position: relative;
  z-index: 2;
  width: max-content;
  max-width: 100%;
  margin: 0 auto;
  min-height: 140px;
}

/* ── Individual bar ── */
.xyl-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  position: relative;
}

.bar-body {
  border-radius: 4px 4px 3px 3px;
  position: relative;
  transition: filter 0.05s, transform 0.05s;
  box-shadow:
    inset 2px 0 4px rgba(255, 255, 255, 0.18),
    inset -2px 0 4px rgba(0, 0, 0, 0.25),
    inset 0 2px 3px rgba(255, 255, 255, 0.15),
    0 4px 12px rgba(0, 0, 0, 0.35);
}

/* Xylophone bar colours — bright rainbow */
.bar-body {
  background: var(--bar-color-xylo);
}

.bar-body.struck {
  filter: brightness(1.5);
  transform: scaleY(0.96) translateY(2px);
}

/* Bar labels */
.bar-note-label {
  font-size: 9px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  text-align: center;
  line-height: 1.15;
  margin-bottom: 1px;
  white-space: nowrap;
}

.bar-solfege-label {
  font-size: 7px;
  color: rgba(255, 230, 140, 0.85);
  text-align: center;
  line-height: 1.15;
  margin-bottom: 1px;
  white-space: nowrap;
}

.bar-key-label {
  font-size: 6.5px;
  color: rgba(255, 255, 255, 0.30);
  font-family: monospace;
  text-align: center;
  line-height: 1.15;
  margin-bottom: 4px;
  white-space: nowrap;
}

/* ── Mallets ── */
.mallets-row {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  min-height: 56px;
  pointer-events: none;
  z-index: 3;
}

.mallet {
  position: absolute;
  top: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-origin: top center;
  transition: transform 0.08s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.left-mallet {
  left: 30%;
}

.right-mallet {
  right: 30%;
}

.mallet-stick {
  width: 3px;
  height: 28px;
  background: linear-gradient(180deg, #d4b896 0%, #a07850 100%);
  border-radius: 2px;
}

.mallet-head {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 1px;
  /* Xylophone = hard round head */
  background: radial-gradient(circle at 35% 35%, #f0e0c0, #8a6030);
}

.mallet.strike {
  transform: rotate(18deg);
}

/* ── Landscape banner ── */
.landscape-banner {
  background: #fefce8;
  border: 1px solid #fde68a;
  border-radius: 0.5rem;
  padding: 8px 14px;
  font-size: 0.75rem;
  color: #92400e;
  text-align: center;
  margin-bottom: 10px;
}

/* ── Composer palette ── */
#xpPalette {
  min-height: 28px;
}

/* ── Composer section ── */
.mt-4.pt-3.border-t.border-gray-100 {
  min-height: 180px;
}

/* ── Ripple ── */
.bar-ripple {
  position: fixed;
  border-radius: 4px;
  pointer-events: none;
  z-index: 50;
  animation: barRip 0.4s ease-out forwards;
}

@keyframes barRip {
  from {
    opacity: 0.7;
    transform: scale(1);
  }

  to {
    opacity: 0;
    transform: scale(1.6);
  }
}

tbody tr:nth-child(even) {
  background: #f9fafb;
}