﻿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);
}

/* â”€â”€ Keyboard container â”€â”€ */
.harmonium-wrap {
  background: #1c1008;
  border-radius: 0.75rem;
  padding: 1rem 0.75rem 1.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* subtle wood grain feel */
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.5), 0 4px 16px rgba(0,0,0,0.2);
  position: relative;
}

/* scroll hint on mobile */
.scroll-hint {
  display: none;
  font-size: 0.7rem;
  color: #9ca3af;
  text-align: center;
  margin-bottom: 0.5rem;
}
@media (max-width: 640px) {
  .scroll-hint { display: block; }
}

/* â”€â”€ Keys wrapper â€” horizontal scroll â”€â”€ */
.keys-outer {
  position: relative;
  min-width: 520px;       /* ensures 30 white keys are always full size */
  height: 140px;
  margin: 0 auto;
  user-select: none;
  -webkit-user-select: none;
}

/* â”€â”€ White keys â”€â”€ */
.key-white {
  position: absolute;
  bottom: 0;
  width: calc(100% / 22 - 2px); /* 22 white keys in 2.5 octaves */
  height: 100%;
  background: linear-gradient(to bottom, #f5f0e8 0%, #fffef8 60%, #e8dfc8 100%);
  border: 1px solid #b8a88a;
  border-radius: 0 0 6px 6px;
  box-shadow: 1px 2px 4px rgba(0,0,0,0.3), inset 0 -2px 4px rgba(0,0,0,0.1);
  cursor: pointer;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.04s, box-shadow 0.04s;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 6px;
  box-sizing: border-box;
}

.key-white.active {
  background: linear-gradient(to bottom, #d4c9a8 0%, #e8ddb8 60%, #c8b898 100%);
  box-shadow: 0 1px 2px rgba(0,0,0,0.3), inset 0 2px 4px rgba(0,0,0,0.15);
  transform: translateY(2px);
}

.key-white:hover:not(.active) {
  background: linear-gradient(to bottom, #ede5d0 0%, #f5efe0 60%, #ddd0b8 100%);
}

/* â”€â”€ Black keys â”€â”€ */
.key-black {
  position: absolute;
  bottom: 42%;
  width: calc(100% / 22 * 0.62);
  height: 58%;
  background: linear-gradient(to bottom, #2a2015 0%, #1a1208 50%, #0d0a04 100%);
  border: 1px solid #0a0804;
  border-radius: 0 0 4px 4px;
  box-shadow: 2px 4px 6px rgba(0,0,0,0.6), inset 0 -1px 3px rgba(255,255,255,0.05);
  cursor: pointer;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.04s;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 4px;
  box-sizing: border-box;
}

.key-black.active {
  background: linear-gradient(to bottom, #3d2e1a 0%, #2a1e0e 50%, #1a1208 100%);
  box-shadow: 1px 2px 3px rgba(0,0,0,0.6), inset 0 2px 3px rgba(0,0,0,0.3);
  transform: translateY(2px);
}

.key-black:hover:not(.active) {
  background: linear-gradient(to bottom, #352818 0%, #221808 50%, #141004 100%);
}

/* â”€â”€ Key labels â”€â”€ */
.key-label {
  font-size: 9px;
  font-weight: 700;
  color: #8a7860;
  letter-spacing: 0.02em;
  pointer-events: none;
  text-transform: uppercase;
}
.key-black .key-label {
  font-size: 8px;
  color: rgba(255,255,255,0.25);
}
.key-white.root .key-label { color: #c84000; font-weight: 800; }

/* label toggle */
.key-label.hidden-label { display: none; }

/* â”€â”€ Octave dividers â”€â”€ */
.octave-marker {
  position: absolute;
  bottom: 2px;
  font-size: 8px;
  color: rgba(255,255,255,0.2);
  pointer-events: none;
  z-index: 0;
  letter-spacing: 0.05em;
}

/* â”€â”€ Note flash â”€â”€ */
.note-flash {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.6rem;
  font-weight: 800;
  color: #fbbf24;
  text-shadow: 0 0 12px rgba(251,191,36,0.7);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.06s;
  z-index: 10;
  white-space: nowrap;
}
.note-flash.show {
  opacity: 1;
  animation: noteFlashAnim 0.5s ease-out forwards;
}
@keyframes noteFlashAnim {
  0%   { opacity: 1; transform: translateX(-50%) scale(1.15); }
  60%  { opacity: 1; transform: translateX(-50%) scale(1.0); }
  100% { opacity: 0; transform: translateX(-50%) scale(0.92); }
}

/* â”€â”€ Bellows indicator â”€â”€ */
.bellows-bar {
  height: 6px;
  background: #e5e7eb;
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.bellows-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  border-radius: 9999px;
  transition: width 0.1s linear;
}

/* â”€â”€ Status dot â”€â”€ */
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #d1d5db;
  display: inline-block;
  transition: background .3s;
}
.dot.active    { background: #10b981; }

/* â”€â”€ Scale/chord badges â”€â”€ */
.scale-btn {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #374151;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.scale-btn:hover { background: #f3f4f6; border-color: #d1d5db; }
.scale-btn.active-scale {
  background: #059669;
  border-color: #059669;
  color: #fff;
}

/* â”€â”€ Octave shift buttons â”€â”€ */
.oct-btn {
  width: 32px; height: 32px;
  border-radius: 0.375rem;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #374151;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}
.oct-btn:hover { background: #f3f4f6; }
.oct-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* â”€â”€ Ripple â”€â”€ */
.tap-ripple {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 50;
  animation: tapRip 0.35s ease-out forwards;
}
@keyframes tapRip {
  from { transform: scale(0); opacity: 0.6; }
  to   { transform: scale(3.5); opacity: 0; }
}

/* â”€â”€ Drone toggle â”€â”€ */
.drone-btn {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #374151;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.drone-btn.on {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

/* â”€â”€ Mobile touch area expand â”€â”€ */
@media (max-width: 640px) {
  .keys-outer { height: 120px; }
  .key-white  { border-radius: 0 0 4px 4px; }
}

/* â”€â”€ Volume slider â”€â”€ */
input[type=range].vol-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 9999px;
  background: #e5e7eb;
  outline: none;
  width: 80px;
}
input[type=range].vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #10b981;
  cursor: pointer;
}
input[type=range].vol-slider::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #10b981;
  border: none;
  cursor: pointer;
}

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

/* â”€â”€ Enable Sound pulse animation â”€â”€ */
#enableSoundBtn {
  animation: pulseEnableBtn 1.6s ease-in-out infinite;
  position: relative;
}
#enableSoundBtn.sound-active {
  animation: none !important;
  border-color: #059669 !important;
  background: #d1fae5 !important;
  color: #065f46 !important;
}
@keyframes pulseEnableBtn {
  0%,100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.55); transform: scale(1); }
  50%      { box-shadow: 0 0 0 8px rgba(245,158,11,0); transform: scale(1.04); }
}