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

:root {
  --pic-wood-light:  #5a4030;
  --pic-wood-mid:    #2e1e10;
  --pic-wood-dark:   #180e06;
  --pic-wood-grain:  rgba(90, 65, 40, 0.40);

  --pic-silver-light: #eef0f3;
  --pic-silver-mid:   #c8cdd4;
  --pic-silver-dark:  #9aa0a8;
  --pic-silver-deep:  #6b7280;

  --pic-key-closed: #c8a84a;   /* gold pad — closed/covered */
  --pic-key-open:   #1a100a;   /* dark hole — open */
  --pic-gold:       #c8a84a;
  --pic-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 ── */
.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);
}

/* ── Piccolo body container ── */
.flute-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 16px 0 8px;
}

/* ── Piccolo instrument visual ──
   Real piccolo is ~32 cm — about 40% shorter than a concert flute.
   We reflect that with max-width: 380px vs flute's 560px.
*/
.flute-instrument {
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 100%;
  max-width: 380px;
  height: 46px;
  position: relative;
}

/* Crown cap — silver, small */
.flute-crown {
  width: 10px;
  height: 22px;
  background: linear-gradient(180deg, var(--pic-silver-light) 0%, var(--pic-silver-mid) 50%, var(--pic-silver-dark) 100%);
  border-radius: 5px 1px 1px 5px;
  flex-shrink: 0;
  box-shadow:
    inset 0 1px 2px rgba(255,255,255,0.7),
    inset 0 -1px 2px rgba(0,0,0,0.25),
    0 2px 5px rgba(0,0,0,0.20);
}

/* Head joint — silver (piccolo headjoint is silver even on wood body) */
.flute-head {
  width: 52px;
  height: 20px;
  background: linear-gradient(180deg, var(--pic-silver-light) 0%, var(--pic-silver-mid) 55%, var(--pic-silver-dark) 100%);
  position: relative;
  flex-shrink: 0;
  box-shadow:
    inset 0 2px 3px rgba(255,255,255,0.55),
    inset 0 -2px 3px rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Silver-to-wood ferrule ring */
.flute-head::after {
  content: '';
  position: absolute;
  right: -3px;
  top: -2px;
  width: 5px;
  height: 24px;
  background: linear-gradient(180deg, var(--pic-silver-light) 0%, var(--pic-silver-mid) 100%);
  border-radius: 1px;
  box-shadow: 1px 0 3px rgba(0,0,0,0.3);
  z-index: 2;
}

/* Embouchure hole */
.flute-embouchure {
  width: 9px;
  height: 7px;
  background: rgba(15, 18, 28, 0.95);
  border-radius: 2px;
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,0.9),
    0 0 0 1.5px var(--pic-gold),
    0 0 0 2.5px rgba(200, 168, 74, 0.25);
}

/* Main tube — dark grenadilla wood */
.flute-tube {
  flex: 1;
  height: 20px;
  background:
    repeating-linear-gradient(
      90deg,
      var(--pic-wood-grain) 0 1px,
      transparent 1px 16px
    ),
    linear-gradient(180deg, var(--pic-wood-light) 0%, var(--pic-wood-mid) 50%, var(--pic-wood-dark) 100%);
  border-top: 1px solid rgba(120, 80, 45, 0.5);
  border-bottom: 1px solid rgba(0,0,0,0.6);
  position: relative;
  box-shadow:
    inset 0 2px 3px rgba(255,255,255,0.07),
    inset 0 -2px 3px rgba(0,0,0,0.45);
}

/* Key pads — solid filled circles, gold when active */
.flute-key-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 100%;
  padding: 0 6px;
}

.tube-key-pad {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  /* Default: open hole — dark inside, silver rim */
  background: var(--pic-key-open);
  border: 1.5px solid var(--pic-silver-mid);
  box-shadow:
    inset 0 1px 3px rgba(0,0,0,0.85),
    inset 0 -1px 2px rgba(0,0,0,0.4);
  transition: background 0.08s, box-shadow 0.08s, border-color 0.08s;
  flex-shrink: 0;
}

/* Active = pad pressed/covered — shows gold pad surface */
.tube-key-pad.active {
  background: radial-gradient(circle at 38% 35%, #e8c060, var(--pic-gold) 60%, var(--pic-gold-dark));
  border-color: var(--pic-gold-dark);
  box-shadow:
    inset 0 1px 2px rgba(255, 220, 100, 0.5),
    0 0 5px rgba(200, 168, 74, 0.55),
    0 1px 2px rgba(0,0,0,0.3);
}

/* Foot joint — wood with silver ferrule rings at both ends */
.flute-foot {
  width: 16px;
  height: 28px;
  background: linear-gradient(180deg, var(--pic-wood-mid) 0%, var(--pic-wood-dark) 70%, #0a0502 100%);
  border-radius: 1px 7px 9px 1px;
  box-shadow:
    inset 0 1px 3px rgba(255,255,255,0.05),
    inset 0 -2px 4px rgba(0,0,0,0.55),
    0 2px 6px rgba(0,0,0,0.35);
  flex-shrink: 0;
  border-top: 1.5px solid var(--pic-silver-dark);
  border-bottom: 1.5px solid var(--pic-silver-dark);
  /* Silver ferrule at the join */
  outline: 1.5px solid rgba(160,170,180,0.3);
  outline-offset: 1px;
}

/* ── Notes grid ──
   Piano-style layout: sharps sit visually between their natural neighbors.
   We use CSS order + margin tricks to achieve the offset feel.
*/
.notes-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  width: 100%;
  max-width: 580px;
}

/* ── Individual note button ── */
.note-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 50px;
  min-height: 64px;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  border: 1.5px solid rgba(190, 175, 145, 0.7);
  /* Warm ivory — natural keys */
  background: linear-gradient(160deg, #f7f2e8 0%, #ede5d4 55%, #ddd4be 100%);
  box-shadow:
    0 3px 8px rgba(0,0,0,0.10),
    inset 0 1px 2px rgba(255,255,255,0.85),
    inset 0 -1px 2px rgba(0,0,0,0.06);
  transition: transform 0.07s, box-shadow 0.07s, background 0.07s;
  position: relative;
  overflow: hidden;
}
.note-btn::before {
  content: '';
  position: absolute;
  top: 0; left: 12%;
  width: 18%;
  height: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.55), 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, #d0e8d4 0%, #a4c8ac 60%, #84a88c 100%);
  box-shadow:
    0 1px 3px rgba(0,0,0,0.15),
    inset 0 2px 4px rgba(0,0,0,0.10),
    0 0 14px rgba(16,185,129,0.28);
}

.note-name {
  font-size: 13px;
  font-weight: 700;
  color: #1a1408;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.note-swar {
  font-size: 9px;
  color: #6a5838;
  line-height: 1.2;
  margin-top: 1px;
}
.note-key {
  font-size: 8px;
  font-family: monospace;
  color: rgba(40, 28, 8, 0.42);
  margin-top: 3px;
  background: rgba(0,0,0,0.05);
  border-radius: 3px;
  padding: 1px 4px;
}

/* Sharp/flat — dark ebony matching the wood body */
.note-btn.sharp {
  background: linear-gradient(160deg, #4a3020 0%, #2e1c0c 55%, #1a0c04 100%);
  min-height: 56px;
  width: 42px;
  border-color: rgba(100, 70, 35, 0.7);
  box-shadow:
    0 3px 8px rgba(0,0,0,0.25),
    inset 0 1px 2px rgba(120,80,40,0.3),
    inset 0 -1px 3px rgba(0,0,0,0.5);
}
.note-btn.sharp .note-name { color: #e8d0a8; }
.note-btn.sharp .note-swar { color: rgba(220, 195, 140, 0.75); }
.note-btn.sharp .note-key  { color: rgba(220, 195, 140, 0.45); background: rgba(255,255,255,0.07); }
.note-btn.sharp:active,
.note-btn.sharp.struck {
  background: linear-gradient(160deg, #204030 0%, #142818 55%, #0c180e 100%);
}

/* ── 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; }
}

/* ── Keyboard hint styling ── */
.key-hint-row {
  font-size: 0.7rem;
  color: #9ca3af;
  text-align: center;
  margin-top: 4px;
  letter-spacing: 0.01em;
}

/* ── Mobile ── */
@media (max-width: 639px) {
  .note-btn       { width: 42px; min-height: 54px; }
  .note-btn.sharp { width: 36px; min-height: 48px; }
  .flute-instrument { height: 38px; max-width: 300px; }
  .flute-head     { width: 40px; height: 16px; }
  .flute-tube     { height: 16px; }
  .tube-key-pad   { width: 10px; height: 10px; }
  .flute-key-display { gap: 5px; }
  .notes-grid     { gap: 4px; }
  .note-name      { font-size: 11px; }
}
