body { font-family: Inter, sans-serif; }

:root {
  --recorder-wood-light: #d4b896;
  --recorder-wood-mid: #b8956a;
  --recorder-wood-dark: #8b6340;
  --recorder-body-light: #e8d5c0;
  --recorder-body-dark: #7a5230;
  --recorder-hole-open: #2a1a0a;
  --recorder-hole-covered: rgba(200, 170, 130, 0.3);
  --recorder-metal: #c8cdd4;
  --recorder-accent: rgba(16, 185, 129, 0.12);
}

.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 14px;
  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;
}
.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;
  white-space: nowrap;
}
.reverb-btn.active {
  background: #fff;
  color: #065f46;
  box-shadow: 0 1px 4px rgba(0,0,0,0.10);
}

/* ── Recorder body container ── */
.recorder-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 16px 0 8px;
}

/* ── Recorder instrument visual ── */
.recorder-instrument {
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 100%;
  max-width: 560px;
  height: 60px;
  position: relative;
}

/* Mouthpiece */
.recorder-mouthpiece {
  width: 60px;
  height: 44px;
  background: linear-gradient(180deg, var(--recorder-body-light) 0%, var(--recorder-wood-mid) 55%, var(--recorder-wood-dark) 100%);
  border-radius: 10px 4px 4px 10px;
  position: relative;
  flex-shrink: 0;
  box-shadow:
    inset 0 2px 4px rgba(255,255,255,0.25),
    inset 0 -2px 4px rgba(0,0,0,0.2),
    0 2px 8px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.recorder-mouthpiece-tip {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 28px;
  background: linear-gradient(180deg, #c8a87a 0%, #8b6340 100%);
  border-radius: 8px 2px 2px 8px;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.2);
}
.recorder-window {
  width: 10px;
  height: 6px;
  background: rgba(20, 10, 2, 0.85);
  border-radius: 1px;
  margin-right: 4px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);
}

/* Main tube */
.recorder-tube {
  flex: 1;
  height: 38px;
  background:
    repeating-linear-gradient(90deg, rgba(255,235,190,0.04) 0 30px, rgba(140,90,40,0.03) 30px 60px),
    linear-gradient(180deg, var(--recorder-body-light) 0%, var(--recorder-wood-mid) 50%, var(--recorder-wood-dark) 100%);
  border-top: 1px solid rgba(200,170,130,0.5);
  border-bottom: 1px solid rgba(80,50,20,0.4);
  position: relative;
  box-shadow:
    inset 0 2px 4px rgba(255,255,255,0.18),
    inset 0 -2px 4px rgba(0,0,0,0.15);
}

/* Hole display on the tube */
.recorder-hole-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  height: 100%;
  padding: 0 16px;
}
.tube-hole {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--recorder-hole-open);
  box-shadow:
    inset 0 1px 3px rgba(0,0,0,0.8),
    0 1px 1px rgba(255,255,255,0.1);
  transition: background 0.08s, box-shadow 0.08s;
  flex-shrink: 0;
}
.tube-hole.covered {
  background: linear-gradient(135deg, var(--recorder-wood-mid), var(--recorder-wood-dark));
  box-shadow:
    inset 0 1px 2px rgba(255,255,255,0.15),
    0 1px 2px rgba(0,0,0,0.25);
}

/* Bell */
.recorder-bell {
  width: 28px;
  height: 52px;
  background: linear-gradient(180deg, var(--recorder-wood-mid) 0%, var(--recorder-wood-dark) 60%, #5a3520 100%);
  border-radius: 2px 12px 14px 2px;
  box-shadow:
    inset 0 2px 4px rgba(255,255,255,0.12),
    inset 0 -2px 4px rgba(0,0,0,0.3),
    0 2px 8px rgba(0,0,0,0.2);
  flex-shrink: 0;
}

/* ── Notes grid ── */
.notes-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 560px;
}

/* ── Individual note button ── */
.note-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 52px;
  min-height: 64px;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  border: 1.5px solid rgba(200, 180, 150, 0.5);
  background: linear-gradient(160deg, var(--recorder-body-light) 0%, var(--recorder-wood-light) 60%, var(--recorder-wood-mid) 100%);
  box-shadow:
    0 3px 8px rgba(0,0,0,0.12),
    inset 0 1px 2px rgba(255,255,255,0.35),
    inset 0 -1px 2px rgba(0,0,0,0.1);
  transition: transform 0.07s, box-shadow 0.07s, background 0.07s;
  position: relative;
  overflow: hidden;
}
.note-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 15%;
  width: 20%;
  height: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.28), rgba(255,255,255,0.04));
  border-radius: 999px;
  pointer-events: none;
}
.note-btn:active,
.note-btn.struck {
  transform: translateY(2px) scale(0.97);
  background: linear-gradient(160deg, #f0e8d8 0%, #c8a870 60%, #a07040 100%);
  box-shadow:
    0 1px 3px rgba(0,0,0,0.18),
    inset 0 2px 4px rgba(0,0,0,0.12),
    0 0 12px rgba(16,185,129,0.25);
}

.note-name {
  font-size: 13px;
  font-weight: 700;
  color: #3d2010;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.note-solfege {
  font-size: 9px;
  color: #7a5030;
  line-height: 1.2;
  margin-top: 1px;
}
.note-key {
  font-size: 8px;
  font-family: monospace;
  color: rgba(80, 50, 20, 0.55);
  margin-top: 3px;
  background: rgba(0,0,0,0.06);
  border-radius: 3px;
  padding: 1px 4px;
}

/* Sharp/accidental notes — slightly different style */
.note-btn.sharp {
  background: linear-gradient(160deg, #c8b090 0%, #a07848 60%, #7a5830 100%);
  min-height: 56px;
  width: 44px;
  border-color: rgba(160, 130, 90, 0.5);
}
.note-btn.sharp .note-name { color: #f0e0c8; }
.note-btn.sharp .note-solfege { color: rgba(240, 220, 190, 0.8); }
.note-btn.sharp .note-key  { color: rgba(240, 220, 190, 0.5); }

/* ── Note ripple ── */
.note-ripple {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 50;
  animation: noteRip 0.45s ease-out forwards;
  border: 2px solid rgba(16, 185, 129, 0.6);
}
@keyframes noteRip {
  from { transform: scale(0); opacity: 1; }
  to   { transform: scale(3.5); opacity: 0; }
}

/* ── Mobile ── */
@media (max-width: 639px) {
  .note-btn {
    width: 44px;
    min-height: 56px;
  }
  .note-btn.sharp {
    width: 38px;
    min-height: 50px;
  }
  .recorder-instrument {
    height: 48px;
  }
  .recorder-tube {
    height: 30px;
  }
  .tube-hole {
    width: 8px;
    height: 8px;
    gap: 10px;
  }
  .recorder-hole-display {
    gap: 10px;
  }
  .notes-grid {
    gap: 5px;
  }
}
