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

/* ── Stylophone Body ── */
.stylophone-body {
  background: #111;
  border-radius: 12px;
  padding: 20px;
  box-shadow: inset 0 2px 5px rgba(255,255,255,0.2), 0 10px 30px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-width: 600px;
  margin: 0 auto;
  user-select: none;
  border: 2px solid #222;
}

/* ── Panel / Grill ── */
.stylo-speaker-grill {
  height: 60px;
  background: 
    radial-gradient(circle at center, #222 2px, transparent 2px),
    #181818;
  background-size: 8px 8px;
  border-radius: 6px;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #000;
}

.stylo-logo {
  color: #a3a3a3;
  font-family: 'Courier New', Courier, monospace;
  font-size: 24px;
  letter-spacing: 4px;
  font-weight: bold;
  text-shadow: 1px 1px 0px #000;
  text-transform: lowercase;
}

/* ── Controls ── */
.stylo-controls {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  background: #2a2a2a;
  padding: 10px 15px;
  border-radius: 6px;
  border-top: 2px solid #333;
  border-bottom: 2px solid #111;
}

.stylo-switch-group, .stylo-rotary-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #ccc;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

/* Base switch wrap */
.stylo-switch-wrap {
  width: 34px;
  height: 20px;
  background: #111;
  border-radius: 10px;
  position: relative;
  cursor: pointer;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.8), 0 1px 1px rgba(255,255,255,0.1);
  transition: all 0.2s;
}
.stylo-switch-handle {
  width: 16px;
  height: 16px;
  background: linear-gradient(to bottom, #f0f0f0, #ccc);
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
  transition: left 0.2s ease-out;
  pointer-events: none;
}
/* Active state for 2-way toggle */
.stylo-switch-wrap.active .stylo-switch-handle {
  left: 16px;
}
.stylo-switch-label {
  font-size: 10px;
  color: #888;
}

/* 3-way Tone Switch */
.stylo-switch-wrap.three-way {
  width: 50px;
}
.stylo-switch-wrap.three-way[data-pos="1"] .stylo-switch-handle { left: 2px; }
.stylo-switch-wrap.three-way[data-pos="2"] .stylo-switch-handle { left: 17px; }
.stylo-switch-wrap.three-way[data-pos="3"] .stylo-switch-handle { left: 32px; }


/* ── Keyboard Area ── */
.stylo-keyboard-wrap {
  background: #e2e8f0; /* Silver tray */
  padding: 8px;
  border-radius: 6px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.4);
  position: relative;
  touch-action: none;
}

.stylo-keyboard {
  position: relative;
  height: 120px;
  width: 100%;
  touch-action: none;
  background: #000;
  border-radius: 4px;
}

/* Keys */
.stylo-key {
  position: absolute;
  background: linear-gradient(to bottom, #e2e8f0 0%, #cbd5e1 100%);
  border: 1px solid #94a3b8;
  border-bottom: 2px solid #64748b;
  border-radius: 2px;
  box-sizing: border-box;
  cursor: crosshair;
}

/* Visual when stylus touches it */
.stylo-key.active {
  background: linear-gradient(to bottom, #f8fafc 0%, #cbd5e1 100%);
  filter: brightness(1.2);
}

/* Note Labels on White Keys */
.stylo-key-label {
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-family: monospace;
  color: #475569;
  pointer-events: none;
}

/* Stylus visual */
.stylo-stylus {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #fef08a; /* tiny yellow spark/tip */
  border-radius: 50%;
  box-shadow: 0 0 10px #fef08a, 0 0 20px #fbbf24;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 100;
}

/* Responsive Scaling */
@media (max-width: 600px) {
  .tool-card { padding: 1rem 0.5rem; }
  .stylophone-body { padding: 12px 6px; }
  .stylo-keyboard-wrap { padding: 4px; }
  .stylo-keyboard { height: 90px; }
  .stylo-key-label { font-size: 8px; bottom: 2px; }
  .stylo-logo { font-size: 18px; }
}
