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

:root {
  --cl-body-light:  #2a2a2a;
  --cl-body-mid:    #1a1a1a;
  --cl-body-dark:   #0d0d0d;
  --cl-silver-light: #eef0f3;
  --cl-silver-mid:   #c8cdd4;
  --cl-silver-dark:  #9aa0a8;
  --cl-pad-open:    #111;
  --cl-gold:        #c8a84a;
  --cl-gold-dark:   #9a7830;
}

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

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

/* ── Instrument container ── */
.flute-body {
  display: flex; flex-direction: column; align-items: center;
  gap: 18px; padding: 14px 0 6px;
}

/* ── Clarinet visual ──
   Clarinet: cylindrical black body, chunky mouthpiece, flared bell.
   Slightly longer than piccolo but shorter than full flute width.
*/
.flute-instrument {
  display: flex; flex-direction: row; align-items: center;
  width: 100%; max-width: 440px; height: 50px; position: relative;
}

/* Mouthpiece — wide, chunky, angled */
.flute-crown {
  width: 32px; height: 20px;
  background: linear-gradient(180deg, #3c3c3c 0%, #1e1e1e 60%, #0e0e0e 100%);
  border-radius: 5px 2px 2px 5px;
  flex-shrink: 0;
  box-shadow:
    inset 0 1px 3px rgba(255,255,255,0.07),
    inset 0 -1px 3px rgba(0,0,0,0.5),
    0 2px 6px rgba(0,0,0,0.4);
  position: relative;
}
/* Ligature band */
.flute-crown::after {
  content: '';
  position: absolute;
  right: 3px; top: -3px;
  width: 5px; height: 26px;
  background: linear-gradient(180deg, var(--cl-silver-light) 0%, var(--cl-silver-mid) 100%);
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* Barrel — connects mouthpiece to upper joint */
.flute-head {
  width: 30px; height: 24px;
  background: linear-gradient(180deg, var(--cl-body-light) 0%, var(--cl-body-mid) 55%, var(--cl-body-dark) 100%);
  position: relative; flex-shrink: 0;
  box-shadow:
    inset 0 2px 3px rgba(255,255,255,0.05),
    inset 0 -2px 3px rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
}
/* Register hole */
.flute-embouchure {
  width: 5px; height: 5px;
  background: rgba(0,0,0,0.98);
  border-radius: 50%;
  box-shadow: inset 0 1px 3px rgba(0,0,0,1), 0 0 0 1px var(--cl-silver-dark);
}

/* Main body tube */
.flute-tube {
  flex: 1; height: 24px;
  background: linear-gradient(180deg, var(--cl-body-light) 0%, var(--cl-body-mid) 50%, var(--cl-body-dark) 100%);
  border-top: 1px solid rgba(70,70,70,0.4);
  border-bottom: 1px solid rgba(0,0,0,0.8);
  position: relative;
  box-shadow:
    inset 0 2px 4px rgba(255,255,255,0.04),
    inset 0 -2px 4px rgba(0,0,0,0.5);
}

.flute-key-display {
  display: flex; align-items: center; justify-content: center;
  gap: 7px; height: 100%; padding: 0 8px;
}

.tube-key-pad {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--cl-pad-open);
  border: 1.5px solid var(--cl-silver-mid);
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.95);
  transition: background 0.08s, box-shadow 0.08s, border-color 0.08s;
  flex-shrink: 0;
}
.tube-key-pad.active {
  background: radial-gradient(circle at 38% 35%, #e8c060, var(--cl-gold) 60%, var(--cl-gold-dark));
  border-color: var(--cl-gold-dark);
  box-shadow: inset 0 1px 2px rgba(255,220,100,0.5), 0 0 6px rgba(200,168,74,0.55);
}

/* Bell — wider flared end */
.flute-foot {
  width: 0; height: 0;
  border-top: 0px solid transparent;
  border-bottom: 0px solid transparent;
  /* Use a div with border-radius for the flared bell shape */
  width: 26px; height: 44px;
  background: linear-gradient(180deg, var(--cl-body-mid) 0%, var(--cl-body-dark) 55%, #050505 100%);
  border-radius: 2px 14px 18px 2px;
  box-shadow:
    inset 0 1px 3px rgba(255,255,255,0.04),
    inset 0 -3px 8px rgba(0,0,0,0.8),
    0 3px 10px rgba(0,0,0,0.45);
  flex-shrink: 0;
  border-top: 1.5px solid var(--cl-silver-dark);
  border-bottom: 2px solid #222;
}

/* ── Register sections ── */
.register-section { width: 100%; max-width: 580px; }

.register-label {
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.10em;
  text-transform: uppercase; margin-bottom: 6px; padding-left: 2px;
}
.chalumeau-label { color: #6ee7b7; }  /* green */
.clarion-label   { color: #93c5fd; }  /* blue */

/* ── Notes grid ── */
.notes-grid {
  display: flex; flex-wrap: wrap;
  gap: 5px; width: 100%; margin-bottom: 14px;
}

/* ── Note buttons ── */
.note-btn {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  width: 48px; min-height: 60px;
  border-radius: 9px; cursor: pointer;
  user-select: none; -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.07s, box-shadow 0.07s, background 0.07s;
  position: relative; overflow: hidden;
  border: 1.5px solid rgba(40,70,45,0.5);
}
.note-btn::before {
  content: '';
  position: absolute; top: 0; left: 12%; width: 16%; height: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.01));
  border-radius: 999px; pointer-events: none;
}

/* Chalumeau — warm forest green */
.note-btn.chalumeau {
  background: black;
}
.note-btn.chalumeau .note-name { color: #86efac; }
.note-btn.chalumeau .note-key  { color: rgba(134,239,172,0.38); }
.note-btn.chalumeau:active,
.note-btn.chalumeau.struck {
  transform: translateY(2px) scale(0.96);
  background: linear-gradient(160deg, #1a5428 0%, #0e3418 55%, #071a0a 100%);
  box-shadow: 0 0 18px rgba(74,222,128,0.45), 0 0 6px rgba(74,222,128,0.3), inset 0 2px 4px rgba(0,0,0,0.3);
  border-color: rgba(74,222,128,0.5);
}
.note-btn.chalumeau.sharp {
  background: black;
  min-height: 50px; width: 38px;
  border-color: rgba(25,50,28,0.6);
}
.note-btn.chalumeau.sharp .note-name { color: #4ade80; }
.note-btn.chalumeau.sharp:active,
.note-btn.chalumeau.sharp.struck {
  transform: translateY(2px) scale(0.96);
  background: linear-gradient(160deg, #12381a 0%, #0a2010 55%, #050e07 100%);
  box-shadow: 0 0 14px rgba(74,222,128,0.40), inset 0 2px 4px rgba(0,0,0,0.3);
  border-color: rgba(74,222,128,0.4);
}

/* Clarion — deep navy blue */
.note-btn.clarion {
  background: black;
  border-color: rgba(30,50,90,0.5);
}
.note-btn.clarion .note-name { color: #93c5fd; }
.note-btn.clarion .note-key  { color: rgba(147,197,253,0.38); }
.note-btn.clarion:active,
.note-btn.clarion.struck {
  transform: translateY(2px) scale(0.96);
  background: linear-gradient(160deg, #1a3a6e 0%, #102548 55%, #081530 100%);
  box-shadow: 0 0 18px rgba(99,179,237,0.50), 0 0 6px rgba(99,179,237,0.35), inset 0 2px 4px rgba(0,0,0,0.3);
  border-color: rgba(99,179,237,0.5);
}
.note-btn.clarion.sharp {
  background: black;
  min-height: 50px; width: 38px;
  border-color: rgba(20,40,75,0.6);
}
.note-btn.clarion.sharp .note-name { color: #60a5fa; }
.note-btn.clarion.sharp:active,
.note-btn.clarion.sharp.struck {
  transform: translateY(2px) scale(0.96);
  background: linear-gradient(160deg, #102a58 0%, #0a1a38 55%, #060f22 100%);
  box-shadow: 0 0 14px rgba(99,179,237,0.45), inset 0 2px 4px rgba(0,0,0,0.3);
  border-color: rgba(99,179,237,0.4);
}

.note-name {
  font-size: 12px; font-weight: 700;
  line-height: 1.2; letter-spacing: -0.01em;
}
.note-key {
  font-size: 8px; font-family: monospace;
  margin-top: 3px; background: rgba(255,255,255,0.05);
  border-radius: 3px; padding: 1px 4px;
}

/* ── 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: 40px; min-height: 52px; }
  .note-btn.sharp   { width: 34px; min-height: 46px; }
  .flute-instrument { height: 42px; max-width: 360px; }
  .flute-tube       { height: 20px; }
  .tube-key-pad     { width: 10px; height: 10px; }
  .flute-key-display { gap: 5px; }
  .notes-grid       { gap: 4px; }
  .note-name        { font-size: 10px; }
}
